import api from './index'

// 发送重置密码验证码
export function sendResetCode(account) {
  return api.post('forgot-password/send-code', {
    account: account
  })
}

// 重置密码
export function resetPassword(account, code, newPassword) {
  return api.post('forgot-password/reset', {
    account: account,
    code: code,
    new_password: newPassword
  })
}

// 检查手机号是否已注册
export function checkPhone(phone) {
  return api.get('forgot-password/check-phone', {
    params: {
      phone: phone
    }
  })
}

// 检查邮箱是否已注册
export function checkEmail(email) {
  return api.get('forgot-password/check-email', {
    params: {
      email: email
    }
  })
}
